<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <body>

        <ui:composition template="./Test.xhtml">



            <ui:define name="content">


                <fieldset style="height: 300px">
                    <legend><b>Add Tickets Category</b></legend>


                    <table width="457" height="190" border="0">
                        <tr>
                            <td width="154"><b> Name *</b></td>
                            <td width="273"> <p:inputText id="name" value="#{ticketsCatBean.tkCat.tcName}" required="true" requiredMessage="Name is not null">
                                    <f:ajax execute="name" listener="#{ticketsCatBean.checkTicketsName}" event="change" />
                                    <f:validator validatorId="Validator.StringValidator"/>
                                </p:inputText>

                            </td>
                            <td>
                                <h:outputText id="display" value="#{ticketsCatBean.msCat}" style="font-size: smaller;font-weight: normal;color: red"/>
                                <h:messages for="name" id="msg"/></td>
                        </tr>
                        <tr>
                            <td><b> Price *</b></td>
                            <td> <p:inputText id="price" value="#{ticketsCatBean.tkCat.price}" required="true" requiredMessage="Price is not null">
                                <f:validator validatorId="Validator.CheckNumber"/>
                                </p:inputText>
                                <h:messages for="price" /></td>
                        </tr>
                        <tr>
                            <td><h:commandButton action="TicketsCategory" actionListener="#{ticketsCatBean.insertTicketsCat}" value="Add new" type="image" image="../resources/images/forms/form_submit.gif"></h:commandButton></td>
                            <td><h:commandButton action="TicketsCategory" value="Cancel" type="image" image="../resources/images/forms/form_reset.gif"/></td>
                        </tr>
                    </table>

                </fieldset>


            </ui:define>



        </ui:composition>

    </body>
</html>
